package com.hjq.mallproduct.web;

import com.hjq.mallproduct.entity.vo.ItemVO;
import com.hjq.mallproduct.service.SkuInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @auther HJQ
 */
@Controller
public class ItemController {
    @Autowired
    SkuInfoService skuInfoService;
    @RequestMapping("/{skuId}.html")
    public  String skuItem(@PathVariable("skuId") Long skuId, Model model){
        ItemVO item=skuInfoService.getItem(skuId);
        model.addAttribute("item",item);
        return  "skuDetail";
    }
}
